#ifndef SUDOKUGRAPHICSCELLDELEGATE_H_
#define SUDOKUGRAPHICSCELLDELEGATE_H_

#include <QStyledItemDelegate>

class SudokuCellValidator;

class SudokuGraphicsCellDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    SudokuGraphicsCellDelegate(QObject* parent = 0);

    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                          const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model,
                      const QModelIndex &index) const;
    void updateEditorGeometry(QWidget *editor,
        const QStyleOptionViewItem &option, const QModelIndex &index) const;


    void paint(QPainter *painter, const QStyleOptionViewItem &option,
                               const QModelIndex &index) const;

private:
    Q_DISABLE_COPY(SudokuGraphicsCellDelegate)

    /**
      * Deleted by parent
      */
    SudokuCellValidator* mValidator;
};

#endif /*SUDOKUGRAPHICSCELLDELEGATE_H_*/
